package org.convallaria.system.biz.entity.dto.sys;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 修改密码DTO
 * 
 * @author convallaria
 * @since 1.0.0
 */
@Data
@Schema(description = "修改密码DTO")
public class ChangePwdDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 原密码
     */
    @Schema(description = "原密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "oldPassword")
    @NotBlank(message = "原密码不能为空")
    private String oldPassword;

    /**
     * 新密码
     */
    @Schema(description = "新密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "newPassword123")
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d@$!%*?&]{6,20}$", 
             message = "密码必须包含字母和数字，长度6-20位")
    private String newPassword;

    /**
     * 确认密码
     */
    @Schema(description = "确认密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "newPassword123")
    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;
}
